package priv.lhy.user.exception;

import lombok.Data;
import priv.lhy.constants.ResponseCodeEnum;

/**
 * author : lihy
 * date : 2019/1/30 13:06
 */
@Data
public class ValidateException extends RuntimeException {
    private static final long serialVersionUID = -8173703386855200633L;

    private String errorCode;
    private String errorMessage;

    public ValidateException() {
        super();
    }

    public ValidateException(String errorCode) {
        super(errorCode);
        this.errorCode = ResponseCodeEnum.SYS_PARAM_NOT_RIGHT.getCode();
        this.errorMessage = ResponseCodeEnum.SYS_PARAM_NOT_RIGHT.getMsg();
    }

    public ValidateException(Throwable cause) {
        super(cause);
    }

    public ValidateException(Throwable cause, String errorCode) {
        super(cause);
        this.errorCode = errorCode;
    }

    public ValidateException(Throwable cause, String errorCode, String errorMessage) {
        super(cause);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    public ValidateException(String errorCode, String errorMessage) {
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }
}
